package utils

import (
	"context"
	"fmt"
	"time"

	"google.golang.org/grpc"
)

func ConnServer() (*grpc.ClientConn, error) {
	ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
	defer cancel()

	addr := fmt.Sprintf("%s:%d", serverHost, serverPort)
	return grpc.DialContext(ctx, addr, grpc.WithBlock(), grpc.WithInsecure())
}
